package entity;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.UUID;

public class Message implements Serializable {
    private static final long serialVersionUID = 3375160901312947644L;

    private UUID uuid;
    private String senderUsername;
    private String receiverUsername;
    private LocalDateTime time;
    private String content;

    public Message(String senderUsername, String receiverUsername, LocalDateTime time, String content) {
        uuid = UUID.randomUUID();
        this.senderUsername = senderUsername;
        this.receiverUsername = receiverUsername;
        this.time = time;
        this.content = content;
    }

    public Message(Message other) {
        this.uuid = other.uuid;
        this.senderUsername = other.senderUsername;
        this.receiverUsername = other.receiverUsername;
        this.time = other.time;
        this.content = other.content;
    }

    public UUID getUuid() {
        return uuid;
    }

    public String getSenderUsername() {
        return senderUsername;
    }

    public String getReceiverUsername() {
        return receiverUsername;
    }

    public LocalDateTime getTime() {
        return time;
    }

    public String getContent() {
        return content;
    }

    public void setTime(LocalDateTime time) {
        this.time = time;
    }
}
